var boxes = {
	/* Login BOX */
	login:{
		show:function(errorString)
		{
			/* Get body size */
			var bodySize = basic.getPageSize();
			
			/* Draw blackOut */
			$('body').append('<div id="divBlackOut"></div>');
			$('#divBlackOut').css({
				'width':  bodySize[0],
				'height': bodySize[1]
			});
	
			/* Draw loginBox */
			$('body').append('<div id="divLoginBox"></div>');
			$('#divLoginBox').css({
				'left':(bodySize[0]/2)-264,
				'top':$('body').scrollTop()+150
			});
	
			$('#divLoginBox').append(''+
				'<div class="fontTahoma size11 bold colorBlack loginBoxHeader">Login</div>'+
				'<div class="loginBoxText">'+
					'<div class="fontTahoma size11 colorBlack loginBoxHostnameText">Hostname</div>'+
					'<div class="fontTahoma size11 colorBlack loginBoxUsernameText">Username</div>'+
					'<div class="fontTahoma size11 colorBlack loginBoxPasswordText">Password</div>'+
				'</div>'+
				'<div class="loginBoxField">'+
					'<div class="loginBoxHostnameField">'+
					 '<input type="text" class="loginBox" id="loginHostname" value="'+((MYSQL_HOST != null)?MYSQL_HOST:config.DEFAULT_HOST)+'">'+
					'</div>'+
					'<div class="loginBoxUsernameField">'+
						'<input type="text" class="loginBox" id="loginUsername" value="'+((MYSQL_USER != null)?MYSQL_USER:config.DEFAULT_USER)+'">'+
					'</div>'+
					'<div class="loginBoxPasswordField">'+
						'<input type="password" class="loginBox" id="loginPassword" value="'+((MYSQL_PASS != null)?MYSQL_PASS:config.DEFAULT_PASS)+'">'+
					'</div>'+
				'</div>'+
				'<div class="loginBoxButton">'+
					'<input type="button" id="loginBoxButton" value="   Login   " onclick="server.requests.login();">'+
				'</div>'+
				'<div class="fontTahoma size10 colorBlack loginBoxStatus" id="loginBoxStatus"></div>'+
			'');
	
			/* Animate */
			$('#divBlackOut').css({'display':'block'});
			$('#divBlackOut').fadeTo('slow',0.5,function(){
				$('#divLoginBox').fadeIn('fast');
			});
	
			window.onscroll = function()
			{
				var bodySize = basic.getPageSize();
				$('#divLoginBox').css({
					'left':(bodySize[0]/2)-264,
					'top':basic.scroll().top+150
				});
			}
		},
		hide:function(callback)
		{
			$('#divBlackOut').fadeIn('fast',function(){
				$('#divLoginBox').fadeOut('fast',function(){
					$('#divBlackOut').fadeOut('fast',function(){
						$('#divBlackOut').remove();
						$('#divLoginBox').remove();
						(callback)();
					});
				});
			});
		}
	},

	/* Error BOX */
	error: {
		show:function(errorString,callback)
		{
			if('undefined' == typeof callback)
			{
				callback = function(){};
			}
			/* Get body size */
			var bodySize = basic.getPageSize();
			
			/* Draw blackOut */
			$('body').append('<div id="divBlackOut"></div>');
			$('#divBlackOut').css({
				'width':  bodySize[0],
				'height': bodySize[1]
			});
	
			/* Draw errorBox */
			$('body').append('<div id="divErrorBox"></div>');
			$('#divErrorBox').css({
				'left':(bodySize[0]/2)-264,
				'top':$('body').scrollTop()+150
			});
	
			$('#divErrorBox').append(''+
				'<div class="fontTahoma size11 bold colorRed errorBoxHeader">ESQuery Error</div>'+
				'<div class="fontCourier size11 errorBoxMessage">'+errorString+'</div>'+
				'<div class="errorBoxButton">'+
					'<input type="button" value="   Close   " onclick="boxes.error.hide('+callback+');">'+
				'</div>'+
			'');
	
			/* Animate */
			$('#divBlackOut').css({'display':'block'});
			$('#divBlackOut').fadeTo('slow',0.5,function(){
				$('#divErrorBox').fadeIn('fast');
			});
	
			window.onscroll = function()
			{
				var bodySize = basic.getPageSize();
				$('#divErrorBox').css({
					'left':(bodySize[0]/2)-264,
					'top':basic.scroll().top+150
				});
			}
		},
		hide:function(callback)
		{
			$('#divBlackOut').fadeIn('fast',function(){
				$('#divErrorBox').fadeOut('fast',function(){
					$('#divBlackOut').fadeOut('fast',function(){
						$('#divBlackOut').remove();
						$('#divErrorBox').remove();
						(callback)();
					});
				});
			});
		}
	}
};